package com.itheima.day03.ZuoYe.ZuoYe4;

public class Staff {
    public void work(Animal1 animal) {
        if(animal instanceof Dog){
            animal.eat();
        }else if(animal instanceof Cat){
            animal.eat();
        }else if(animal instanceof Pig){
            animal.eat();
        }else{
            System.out.println("暂无该动物");
        }
    }
}
